/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package co.gov.igac.observatorio.entidades.idea;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author jgamba
 */
@Entity
@Table(name = "investigador")
@NamedQueries({
    @NamedQuery(name = "Investigador.findAll", query = "SELECT i FROM Investigador i"),
    @NamedQuery(name = "Investigador.findByIdInvestigador", query = "SELECT i FROM Investigador i WHERE i.idInvestigador = :idInvestigador"),
    @NamedQuery(name = "Investigador.findByNombreCompleto", query = "SELECT i FROM Investigador i WHERE i.nombreCompleto = :nombreCompleto"),
    @NamedQuery(name = "Investigador.findByDireccion", query = "SELECT i FROM Investigador i WHERE i.direccion = :direccion"),
    @NamedQuery(name = "Investigador.findByCiudad", query = "SELECT i FROM Investigador i WHERE i.ciudad = :ciudad")})
public class Investigador implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "idInvestigador")
    private Integer idInvestigador;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "nombreCompleto")
    private String nombreCompleto;
    @Size(max = 45)
    @Column(name = "direccion")
    private String direccion;
    @Size(max = 45)
    @Column(name = "ciudad")
    private String ciudad;
    @OneToMany(mappedBy = "investigador")
    private List<Idea> ideaList;

    public Investigador() {
    }

    public Investigador(Integer idInvestigador) {
        this.idInvestigador = idInvestigador;
    }

    public Investigador(Integer idInvestigador, String nombreCompleto) {
        this.idInvestigador = idInvestigador;
        this.nombreCompleto = nombreCompleto;
    }

    public Integer getIdInvestigador() {
        return idInvestigador;
    }

    public void setIdInvestigador(Integer idInvestigador) {
        this.idInvestigador = idInvestigador;
    }

    public String getNombreCompleto() {
        return nombreCompleto;
    }

    public void setNombreCompleto(String nombreCompleto) {
        this.nombreCompleto = nombreCompleto;
    }

    public String getDireccion() {
        return direccion;
    }

    public void setDireccion(String direccion) {
        this.direccion = direccion;
    }

    public String getCiudad() {
        return ciudad;
    }

    public void setCiudad(String ciudad) {
        this.ciudad = ciudad;
    }

    public List<Idea> getIdeaList() {
        return ideaList;
    }

    public void setIdeaList(List<Idea> ideaList) {
        this.ideaList = ideaList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idInvestigador != null ? idInvestigador.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Investigador)) {
            return false;
        }
        Investigador other = (Investigador) object;
        if ((this.idInvestigador == null && other.idInvestigador != null) || (this.idInvestigador != null && !this.idInvestigador.equals(other.idInvestigador))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "co.gov.igac.observatorio.entidades.idea.Investigador[ idInvestigador=" + idInvestigador + " ]";
    }
    
}
